home *** CD-ROM | disk | FTP | other *** search
Wrap
RISC OS BBC BASIC V Source | 2000-10-15 | 14.7 KB | 725 lines
Super Foul Egg Yet another Conversion from the Amiga. Started Wed 31st January 1996 by Owain Cole. Visions of the Impossible. *KEY 1 QUIT|M $;" at line "; ("FX 15"): error *FX 15,1 *PlayPause 1 "Stasis_VolSlide",1,0,20 "Stasis_VolSlide",2,0,20 "Stasis_VolSlide",3,0,20 "Stasis_VolSlide",4,0,20 setupplayers setupscreen(npl%) A%=area% B%=npl% C%=options% D%=memtemp% palive%= (gameloop) somebodieswon(palive%) "OS_CheckModeValid",49 yesno% "XOS_Module",18,"Portable" ;flags% (flags% 1)=0 yesno%=-1 yesno%<0 vga%= vga%= <100 <>13 <>49 vga%= Check for Sprite Extend "XOS_Module",18,"SpriteExtend" ;flags% spop%=52 (flags% 1)=1 vga%= :spop%=34: <>13 Check for joystick "XOS_Module",18,"Joystick" ;flags% joystick%= flags% joystick%= "Huffman_Decompress",-1,"<SFEG$Dir>.ScreensHuf" backspritelen% backspritelen%+=4 backsprites% backspritelen% 8 !backsprites%=backspritelen% "Huffman_Decompress",backsprites%+4,"<SFEG$Dir>.ScreensHuf" "Huffman_Decompress",-1,"<SFEG$Dir>.MenuBsHuff" spritelen% spritelen%+=4 spr% spritelen% !spr%=spritelen% "Huffman_Decompress",spr%+4,"<SFEG$Dir>.MenuBsHuff" ("<SFER$Dir>.Inkeys") X=0 1,"Inkeys not found." keylen%= keys% keylen% ("Load <SFER$Dir>.Inkeys &"+ ~keys%) Set up pointer for enter key &2E,256+36,spr%,"ptr_enter",2+(%1100000),0,0,0,0 cols%=4 npl%=2 lowcompspeed%=3 hicompspeed%=1 memtemp% 1024,partexplo% 4*1024 Controls bit! -1 IS COMPUTER CONTROLED ctrls%(4) options% 1024,vduin% 20,vduout% 20,scale% 20 scale%!0=2 scale%!4=2 scale%!8=2 scale%!12=2 assemble vduin%!0=148 vduin%!4=149 vduin%!8=7 vduin%!12=-1 d)options%!0=8 : Player falling speed e$options%!4=cols% : No. colours f8options%!8=&FF: Auto falling if &FF, or manual if 0 g7options%!16=lowcompspeed% : Computer falling speed options%!20=memtemp% options%!24=partexplo% options%!512=1 : loop%=0 l!options%!(28+(loop%*4))=loop% options%!48=2 Load the new key set if any? "XOS_CLI","Load <SFEops$Dir>.Keys &"+ ~keys loadoptions area% 1024*4 Scores dim!! score%(4) letgo%= Dont allow escape *FX 14,6 fadeout *PLAYPAUSE 0 &6,112,2 scale%!0=2 scale%!4=2 scale%!8=2 scale%!12=2 vga%= yoff%=0 res%=2:scale%!4=4 yoff%=16*4 res%=0:scale%!4=2 &2E,spop%+256,backsprites%,"menu",0,yoff%,0,scale%,0 drawkeys drawcols drawplayers drawspeed tickm &6,122,1 fadeup *FX 13,6 Reallow escape X%,Y%,Z% (-26) X%-=8: X%,Y% (-122) X%+=8: X%,Y% (-58) Y%+=8: X%,Y% (-42) Y%-=8: X%,Y% Z%<>0 (-74) Y%=Y%-yoff% (X%>670 Y%<811) (X%<703 Y%>781) options%!8=&FF: tickm (X%>670 Y%<874) (X%<703 Y%>847) options%!8=0: tickm (X%>937 Y%<742) (X%<973 Y%>715) options%!16=lowcompspeed%: tickm (X%>1030 Y%<742) (X%<(1030+36) Y%>715) options%!16=(lowcompspeed%+hicompspeed%)/2: tickm (X%>1123 Y%<742) (X%<1157 Y%>715) options%!16=hicompspeed%: tickm (X%>43 Y%<148) (X%<103 Y%>72) options%!4>3 options%!4=options%!4-1: drawcols:letgo%= (X%>502 Y%<148) (X%<562 Y%>72) options%!4<6 options%!4=options%!4+1: drawcols:letgo%= X%>828 Y%<506 X%<1195 Y%>293 checkchangekey(X%,Y%) X%>58 Y%<838 X%<121 Y%>754 npl%>2 npl%-=1: drawplayers:letgo%= X%>394 Y%<838 X%<454 Y%>754 npl%<4 npl%+=1: drawplayers:letgo%= X%>130 X%<386 Y%>769 Y%<833 changeaplayer(X%,Y%):letgo%= X%>61 Y%>475 X%<115 Y%<533 options%!0<9 options%!0=options%!0+1: drawspeed:letgo%= X%>338 Y%>475 X%<454 Y%<533 options%!0>1 options%!0=options%!0-1: drawspeed:letgo%= X%>750 Y%<172 X%<824 Y%>89 savestuff X%>1048 X%<2201 Y%>85 Y%<163 fadeout: Next bit makes sure they've let go of the button letgo%= X%,Y%,Z% Z%=0 (-74)) letgo%= (X%>859 Y%<166) (X%<1009 Y%>91) Reset scores loop%=1 score%(loop%)=0 tickm options%!8=&FF tick(670,776): untick(670,840) untick(670,776): tick(670,840) options%!16=lowcompspeed% @ tick(937,708): untick(1123,708): untick(1030,708) options%!16=hicompspeed% untick(937,708): tick(1123,708): untick(1030,708) untick(937,708): untick(1123,708): tick(1030,708) drawplayers loop% loop%=1 npl% &2E,spop%+256,spr%,"pl"+ ctrls%(loop%),66+loop%*64,770+yoff%,0,scale%,0 npl%<4 loop%=npl%+1 &2E,spop%+256,spr%,"blank",66+loop%*64,770+yoff%,0,scale%,0 drawspeed loop%,speed% speed%=9-(options%!0) speed%>0 loop%=1 speed% &2E,spop%+256,spr%,"speedbar",98+loop%*32,484+yoff%,0,scale%,0 speed%<8 loop%=speed%+1 &2E,spop%+256,spr%,"halfblank",98+loop%*32,484+yoff%,0,scale%,0 changeaplayer(x%,y%) x%=1+(x%-130)/64 ctrls%(x%) joystick%= ctrls%(x%)=5 ctrls%(x%)=x%-1 0,1,2,3:ctrls%(x%)=-1 4:ctrls%(x%)=x%-1 5:ctrls%(x%)=4 drawplayers drawcols numofcs%,loop% numofcs%=options%!4 loop%=1 numofcs% &2E,spop%+256,spr%,"cl"+ loop%,48+loop%*64,82+yoff%,0,scale%,0 numofcs%<6 loop%=numofcs%+1 &2E,spop%+256,spr%,"blank",48+loop%*64,82+yoff%,0,scale%,0 checkchangekey(X%,Y%) loop%,y% loop%=0 y%=473-loop%*60 X%>828 Y%>y% X%<828+34 Y%<y%+34 changekey(loop%,0) X%>938 Y%>y% X%<938+34 Y%<y%+34 changekey(loop%,1) X%>1050 Y%>y% X%<1050+34 Y%<y%+34 changekey(loop%,2) X%>1161 Y%>y% X%<1161+34 Y%<y%+34 changekey(loop%,3) changekey(set%,key%) pointer%,inkey%,y%,x%,loop% pointer%=keys+set%*16+key%*4 &06,106,2 : Select the pointer y%=473-set%*60+yoff% x%=828+key%*111 &2E,256+spop%,spr%,"kblank",x%,y%,0,scale%,0 (-74)) inkey%=0 loop%=1 (-loop%) keys%!((loop%-1)<<2)<>0 inkey%=-loop% X%,Y%,Z% : This unbuffers the mouse! inkey%<>0 !pointer%=inkey% &06,106,1 : Reselect the pointer drawkeys letgo%= drawkeys yloop%,xloop%,y%,inkey%,x% yloop%=0 y%=473-yloop%*60+yoff% xloop%=0 x%=828+xloop%*111 1-inkey%= (keys!((yloop%*16)+(xloop%*4)))-1 &2E,256+spop%,spr%,$(keys%+keys%!(inkey%*4)),x%,y%,0,scale%,0 tick(X%,Y%) &2E,spop%+256,spr%,"tick",X%,Y%+yoff%,0,scale%,0 untick(X%,Y%) &2E,spop%+256,spr%,"emttick",X%,Y%+yoff%,0,scale%,0 dm(num%) @!=area%+((num%-1) npl%)*1024 setupplayers rndseed%= D leftcol%=142+ (options%!4)*4 E!rightcol%=142+ (options%!4)*4 npl%=1 npl%=2:ctrls%(2)=-1 setupplayer(area%,ctrls%(1),16,32,area%+1024, dm(npl%),1,rndseed%,leftcol%,rightcol%) setupplayer(area%+1024,ctrls%(2),160+48,32, dm(3),area%,2,rndseed%,leftcol%,rightcol%) npl%>2 setupplayer(area%+2048,ctrls%(3),16,240+32, dm(4),area%+1024,3,rndseed%,leftcol%,rightcol%) npl%>3 setupplayer(area%+3072,ctrls%(4),160+48,240+32,area%,area%+2048,4,rndseed%,leftcol%,rightcol%) setupscreen(players%) Disallow escape *FX 14,6 fadeout &06,112,2 : Set Vdu to other bank scale%!0=2 scale%!4=2 scale%!8=2 scale%!12=2 res%=0 vga%= yoff%=0 res%=2:scale%!4=4 \) players%>2 res%=0:scale%!4=2 yoff%=16*4 res%=0:scale%!4=2 `) players%>2 res%=1:scale%!4=1 options%!12=res% c*!resoltion=res% : Just to make sure! &2E,spop%+256,backsprites%,"playfield",0,yoff%,0,scale%,0 players%>2 &2E,spop%+256,backsprites%,"playfield",0,yoff%+120*4,0,scale%,0 players%=3 g$ A%=area%+1024*3 : Player 4 A%!0=0 A%!756=160+48 A%!760=240+32 xloop%=0 yloop%=0 mT (xloop% 7)=0 A%?(40+xloop%+yloop%*8)=254 A%?(40+xloop%+yloop%*8)=255 n# A%?(368+xloop%+yloop%*8)=25 o p A%?(40+1+12*8)=252 A%?(40+6+12*8)=253 xloop%=2 A%?(40+xloop%+12*8)=255 u C%=options% drawplayersscreen x yKpartexplo%!0=&FF000000 : Set the end of the particale explosion thing plotscore(1) plotscore(2) players%>2 plotscore(3) players%>3 plotscore(4) plotnametags &06,112,1 fadeup drawpausedscreen *FX 13,6 setupplayer(t%,control%,xco%,yco%,passto%,getfrom%,soundchan%,rndseed%,leftcol%,rightcol%) xloop%=0 yloop%=0 (xloop% 7)=0 t%?(40+xloop%+yloop%*8)=254 t%?(40+xloop%+yloop%*8)=0 t%?(40+1+12*8)=252 t%?(40+6+12*8)=253 xloop%=2 t%?(40+xloop%+12*8)=255 .!t%=0 : Set it at start of thing t%!4=5 t%!8=-1 t%!16=1 t%!20=0 t%!28=control% t%!32=0 t%!36=0 t%!144=0 t%!756=xco% t%!760=yco% t%!728=getfrom% t%!732=passto% t%!772=rndseed% t%!800=soundchan% t%!810=0 t%?808=leftcol% t%?809=rightcol% xco%<160 t%!792=xco%+16*6+8 t%!792=xco%-16*3+8 t%!796=yco%+16*3+4 t%?148=255 loop%=t%+368 t%+471 ?loop%=251 npl%>2 t%!816=soundchan% t%!816=soundchan%+2 assemble limit%=100*1024 code% limit% ("Load <SFE$Dir>.GameCode &"+ ~code%) gameloop=code%+!code% #drawplayersscreen=code%+code%!4 keys=code%+code%!8 resoltion=code%+code%!12 graphicsindex=code%+code%!16 !partexplocode%=code%+code%!20 "XOS_CLI","Load <SFEG$Dir>.<IndexFile> &"+ ~graphicsindex fadeoutandend *FX 14,6 fadeout *FX 13,6 error (-2) fadeoutandend: "Ohh dear, the game has a hidious bug in it. Arrrrgggggh. Please tell somebody in the 'know' that this has happened. Or just play on like you normally do since you have no conscious." " For those in the know," $;" at line "; *FX 13,6 somebodieswon(pl%) plyrs%,poi% pl%>-1 pl%<4 score%(pl%+1)+=1 plyrs%=((npl%-1) 2)+1 loop%=0 npl%-1 vga%= yoff%=0 res%=2:scale%!4=4 yoff%=16*4 res%=0:scale%!4=2 poi%=area%+1024*loop% loop%<2 npl%>2 ypos%=600+yoff% loop%<2 npl%<3 ypos%=400+yoff% loop%>1 ypos%=150+yoff% pl%<>loop% K &2E,256+spop%,spr%,"pressakey",100+(poi%!756)*4,ypos%,0,scale%,0 D &2E,256+spop%,spr%,"winner",(poi%!756)*4,ypos%,0,scale%,0 plotscore(loop%+1) partexplocode% >T+50 *FX 15,1 partexplocode% joystick%= % "Joystick_Read",0 ' (R0 &10000)<>0 I$="H" % "Joystick_Read",1 ' (R0 &10000)<>0 I$="H" I$<>"" plotscore(pl%) xpo%,ypos%,score$,loop% vga%= yoff%=0 scale%!4=4 % npl%>2 res%=0:scale%!4=2 yoff%=16*4 scale%!4=2 % npl%>2 res%=1:scale%!4=1 npl%>2 % pl%=1 xpos%=570:ypos%=675 % pl%=2 xpos%=750:ypos%=625 % pl%=3 xpos%=570:ypos%=200 % pl%=4 xpos%=750:ypos%=150 % pl%=1 xpos%=570:ypos%=400 % pl%=2 xpos%=750:ypos%=300 score$= (score%(pl%)) (score$)<3 score$="0"+score$ loop%=1 (score$) &2E,spop%+256,spr%,"NUM"+ score$,loop%,1),xpos%-( (score$)*44)+44*loop%,yoff%+ypos%,0,scale%,0 fadeout &06,112,2 "OS_ReadVduVariables",vduin%,vduout% &06,112,1 Save screen in other bank "PsychoEffect_Fade",vduout%!4,vduout%!0,vduout%!8,60,320 loop%=60 "PsychoEffect_Fade",vduout%!0,vduout%!4,vduout%!8,loop%,320 fadeup &06,112,2 "OS_ReadVduVariables",vduin%,vduout% &06,112,1 loop%=0 "PsychoEffect_Fade",vduout%!0,vduout%!4,vduout%!8,loop%,320 savestuff savekeys saveoptions Unbuffer mouse X%,Y%,Z% savekeys "XOS_CLI","Save <SFEops$Dir>.Keys &"+ ~keys+" + &"+ saveoptions loop%=0 7+options%!(28+(loop%*4))=ctrls%(loop%+1) options%!48=npl% "XOS_CLI","Save <SFEops$Dir>.Options &"+ ~options%+" + &"+ loadoptions "XOS_CLI","Load <SFEops$Dir>.Options &"+ ~options% loop%=0 @+ctrls%(loop%+1)=options%!(28+(loop%*4)) npl%=options%!48 options%!24=partexplo% plotnametags div% players%>2 div%=2 div%=1 ctrls%(1)=-1 &2E,spop%+256,spr%,"cpu",508,(960-(420/div%))+yoff%,0,scale%,0 a$="2up" ctrls%(2)=-1 a$="cpu" &2E,spop%+256,spr%,a$,694,(960-(420/div%))+yoff%,0,scale%,0 players%>2 a$="3up" ctrls%(3)=-1 a$="cpu" &2E,spop%+256,spr%,a$,508,(480-(420/div%))+yoff%,0,scale%,0 players%>3 a$="4up" ctrls%(3)=-1 a$="cpu" &2E,spop%+256,spr%,a$,694,(480-(420/div%))+yoff%,0,scale%,0 drawpausedscreen Sets up the paused screen on the other bank &6,112,2 Set it to a dogy scale setting scale%!4=2 vga%= npl%<3 scale%!4=4 div%=1 npl%>2 div%=2 pause(64,(960-(128/div%))+yoff%) pause(832,(960-(128/div%))+yoff%) npl%>2 pause(64,(960-(1088/div%))+yoff%) npl%>3 pause(832,(960-(1088/div%))+yoff%) &6,112,1 Set scale back to normal vga%= yoff%=0 res%=2:scale%!4=4 p) players%>2 res%=0:scale%!4=2 yoff%=16*4 res%=0:scale%!4=2 t) players%>2 res%=1:scale%!4=1 pause(x%,y%) vga%= npl%>2 loop%=2 loop%=1 &2E,spop%+256,spr%,"paused",x%,y%-(loop%*64)/div%,0,scale%,0